<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>字面量</title>
	</head>
	<body>
	</body>
	<script>
		var obj = {};
		obj.uname = '张三';
		obj.uage = 20;
		obj.speak = function(){
			console.log('q我果果');
		}
		obj.speak();
		/*此种调用，属性必须加单引号*/
		console.log(obj['uname']);
		/*对象的方法定义时，使用匿名函数*/
		var obj2 = {
			uname:'李四',
			uage:16,
			speak:function(){
				console.log('tfutfu');
			}
		}
		/*调用时：对象.方法(),方法后面必须加括号*/
		obj2.speak();
	</script>
</html>
